package com.dhl.fin.api.domain;

import com.dhl.fin.api.common.domain.BasicDomain;
import com.dhl.fin.api.dto.RemindCardInfoDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;

import javax.persistence.*;
import java.util.List;

/**
 * @author CuiJianbo
 * @since 2025/5/2
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@Table(name = "t_remind_type")
public class RemindType extends BasicDomain {

    private String unicode;

    private Integer sort;

    private String remindTypeName;

    private String icon;

    /**
     * 是启用还是停用
     */
    private Boolean isActive;

    /**
     * 是否为系统内置固定的
     */
    private Boolean isFix;

    @OneToMany(mappedBy = "remindType")
    private List<RemindTask> remindTasks;

    @OneToMany(mappedBy = "remindType")
    private List<MensesRemindTask> mensesRemindTasks ;

    public static RemindCardInfoDTO changeToRemindCardInfoDTO(RemindType remindType) {
        RemindCardInfoDTO remindCardInfoDTO = new RemindCardInfoDTO();
        BeanUtils.copyProperties(remindType, remindCardInfoDTO);
        return remindCardInfoDTO;
    }
}


